class StatisticCategory < ActiveRecord::Base
end


class AgeStatistic < StatisticCategory
  def self.get_category(age)
    return StatisticCategory::AgeStatistic.find(:first,
                                                :conditions => ["upper >= ? and lower <= ?" , age,age])
  end
end

class ExpStatistic < StatisticCategory
  def self.get_category(exp)
    categories=StatisticCategory::ExpStatistic.find(:first,
                                                    :conditions => ["upper >= ? and lower <= ?" , exp,exp])
  end
end

class SexStatistic < StatisticCategory
  def self.get_category(sex)
    return sex ? SexStatistic.find_by_upper(1) : SexStatistic.find_by_upper(0)
  end
end
